// SETUP

#include intrographics.txt
#include ladyluckbiggraphics.txt

setdatapath("data/graphics/cutscenes/jester/");

var jestergraphics = {
	idle: {
		animation: "jester_idle.json",
		pack: "jester.pck",
		loop: true
	},
	defiant_idle: {
		animation: "jester_defiant_idle.json",
		pack: "jester.pck",
		loop: true
	}
}
var jester = addsprite("jester", 1, jestergraphics);

// HELPER FUNCTIONS	

var fade_time = 0.4;

// ACTORS
actor("Lady Luck", screenwidthmid + 800, 550, Col.YELLOW, CENTER, BOTTOM, "chat_ladyluck", "characters/misc/charicon_ladyluck");
actor("Jester", 2600, 600, Col.multiplylightness(Col.RED, 1.25), RIGHT, TOP, "chat_jester", "characters/jester/charicon_jester");

// INTRO

play("music_cutscene_lesscheery");

jester.scale = 0.5;
jester.x = 2600 - ((jester.getwidth("idle") * jester.scale) / 2);
jester.y = 670;
changebackground("intro_stage");
fadein();
jester.show("idle");

ladyluck_big.x = -screenwidth;
ladyluck_big.show("idle-confused");
Actuate.tween(ladyluck_big, 2, { x: 0 }).ease(Expo.easeOut);

wait(0.5);

ladyluck_big.show("talking-confused", true);
actor("Lady Luck", screenwidthmid + 240, screenheightmid - 240, Col.YELLOW, RIGHT, BOTTOM, "chat_ladyluck", "characters/misc/charicon_ladyluck");
speak("Lady Luck", "Oh, it’s you again.");
ladyluck_big.show("talking-sly", true);
speak("Lady Luck", "How’s the despair going?");
speak("Lady Luck", "What about the sickening waves of regret?");
ladyluck_big.show("idle-sly", true);

actor("Jester", 2600, 670, Col.multiplylightness(Col.RED, 1.25), CENTER, BOTTOM, "chat_jester", "characters/jester/charicon_jester");
speak("Jester", "Pretty much under control, to be honest!");

actor("Lady Luck", screenwidthmid + 240, screenheightmid - 280, Col.YELLOW, RIGHT, BOTTOM, "chat_ladyluck", "characters/misc/charicon_ladyluck");
ladyluck_big.show("talking-confused", true);
speak("Lady Luck", "You know this is going to end terribly.");
ladyluck_big.show("idle-confused", true);

speak("Jester", "I was already trapped for eternity!");
speak("Jester", "That *is* ending terribly!");

ladyluck_big.show("talking-sly", true);
actor("Lady Luck", screenwidthmid + 240, screenheightmid - 240, Col.YELLOW, RIGHT, BOTTOM, "chat_ladyluck", "characters/misc/charicon_ladyluck");
speak("Lady Luck", "Well, next time round you won’t have a cushy job in|the introductions and razzle-dazzle department.");
speak("Lady Luck", "You’ll be down on level one, hanging out with the frog|and that unbearable space guy. ALL DAY, EVERY DAY.");
ladyluck_big.show("idle-sly", true);

speak("Jester", "You know what they say - a change|is as good as a holiday!");

ladyluck_big.show("talking-sly", true);
actor("Lady Luck", screenwidthmid + 240, screenheightmid - 280, Col.YELLOW, RIGHT, BOTTOM, "chat_ladyluck", "characters/misc/charicon_ladyluck");
speak("Lady Luck", "Well, you should enjoy this CHANGE I’m|making to the rules, then! IN YOU GO...");
ladyluck_big.show("idle-sly", true);

startgamefromcutscene();